package ncsutest.monitors;
import ncsutest.NCSUTestMonitor;
import ncsutest.util.LEDs;

import com.sun.spot.sensorboard.peripheral.LEDColor;
import com.sun.spot.testFramework.ITestResultLog;

public class LEDTestMonitor extends NCSUTestMonitor {
	public LEDTestMonitor(ITestResultLog sublog) {
		super(sublog);
	}

	public void reportSuccess(int testNo) {
		int index = testNumberToIndex(testNo);
		LEDs.setLED(index, LEDColor.GREEN);
		
		super.reportSuccess(testNo);
	}

	public void reportError(int testNo) {
		int index = testNumberToIndex(testNo);
		LEDs.setLED(index, LEDColor.YELLOW);

		super.reportError(testNo);
	}

	public void reportFailure(int testNumber, String exceptionMessage) {
		int index = testNumberToIndex(testNumber);
		LEDs.setLED(index, LEDColor.RED);

		super.reportFailure(testNumber, exceptionMessage);
	}
}
